home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dirut / secret3.zip / MDSECRE2.ASM < prev    next >
Assembly Source File  |  1992-10-17  |  2KB  |  68 lines

  1. TITLE    MDSECRET    5-9-85    [10-17-92]
  2. ;v1.1    Toad Hall Rewrite of a disassembly of MDSECRET.COM
  3. ;    Severe tightening: a virtual rewrite.
  4. ;    Released to the public domain.
  5. ;
  6. ;v1.2    Added cmdline processing as well as prompted entry
  7. ;    in common GETPARM.INC.
  8. ;
  9. ;    David Kirschbaum
  10. ;    Toad Hall
  11.  
  12. LF    EQU    0AH
  13. CR    EQU    0DH
  14.  
  15. CSEG    SEGMENT
  16.     ASSUME DS:CSEG, SS:CSEG ,CS:CSEG ,ES:CSEG
  17.     ORG    100H
  18.  
  19. MDSecret    PROC    NEAR
  20.  
  21.     jmp    Start            ;v1.2
  22.  
  23. logo    label    byte
  24. db    'MDSECRET: Creates "secret" directory.',CR,LF
  25. db    'Usage:  MDSECRET [dirnam]',CR,LF
  26. db    'Where [dirname] is a legal directory name (up to 7 chars max).',CR,LF
  27. db    'v1.2 Public domain rewrite of an old 1985 standard.',CR,LF
  28. db    'David Kirschbaum, Toad Hall',CR,LF,'$'
  29.  
  30. Start:    call    GetParm            ;get directory name        v1.2
  31.     jc    MsgTerm            ;no or illegal input, fail    v1.2
  32.                     ;(msg in DX, AL=-1)
  33.  
  34. ;DS:DX -> directory name start, CX = name length.
  35.  
  36.     MOV    AH,39H            ;create subdirectory
  37.     INT    21H            ;DS:DX -> AsciiZ name
  38.     JB    Failed140        ;create failed, error in AL
  39.  
  40. ;Directory is now created.
  41. ;Change its attribute to system
  42.  
  43.     MOV    CX,2            ;system attribute
  44.     MOV    AX,4301H        ;set file attribute
  45.     int    21H            ;DS:DX still -> dirname        v1.1
  46.     jmp    short Term        ;terminate, ERRORLEVEL 0    v1.1
  47.  
  48. Failed140:
  49.     add    error1F9,al        ;error msg digit        v1.1
  50.     MOV    DX,OFFSET msg1F0    ;'Error # x'
  51.  
  52. ;v1.1 Display message in DX, terminate with ERRORLEVEL in AL
  53.  
  54. MsgTerm:
  55.     push    ax            ;save errorlevel        v1.1
  56.     MOV    AH,9            ;display msg in DX
  57.     INT    21H
  58.     pop    ax            ;restore errorlevel        v1.1
  59. Term:    mov    ah,4CH            ;terminate, ERRORLEVEL in AL    v1.1
  60.     int    21H            ;v1.1
  61.  
  62. MDSecret    ENDP
  63.  
  64. INCLUDE    GETPARM.INC            ;v1.2
  65.  
  66. CSEG    ENDS
  67.     END    MDSecret
  68.